Update logger example to account for CompilerDiagnostic in CompilerError.details#8251
Open
phryneas wants to merge 1 commit intoreactjs:mainfrom
Open
Update logger example to account for CompilerDiagnostic in CompilerError.details#8251phryneas wants to merge 1 commit intoreactjs:mainfrom
CompilerDiagnostic in CompilerError.details#8251phryneas wants to merge 1 commit intoreactjs:mainfrom
Conversation
…rError.details` `event.detail` in the logger example could either be `CompilerErrorDetail` or `CompilerDiagnostic`, yet the example only handled the simpler (but deprecated) `CompilerErrorDetail`. This adds a call to `primaryLocation` (if present) to account for the different structure of `CompilerDiagnostic` - `loc` is not present there.
Size changesDetails📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disclaimer: I swear that this is not AI slop or any other kind of spam, but a real problem I encountered by following the current docs, which lead me to dig into the source code.
I just want to correct the example so others have an easier time following the docs.
event.detailin the logger example could either beCompilerErrorDetailorCompilerDiagnostic, yet the example only handled the simpler (but deprecated)CompilerErrorDetail.In reality, I've seen both of these show up in the
loggerfunction.This adds a call to
primaryLocation(if present) to account for the different structure ofCompilerDiagnostic-locis not present there.